@extends('layout.master')

@section('title','添加打卡配置')

@section('css')
    @parent
    <link href="{{ asset('plugins/bower_components/summernote/dist/summernote.css') }}" rel="stylesheet"/>
    <!-- animation CSS -->
    <link href="{{ asset('css/animate.css') }}" rel="stylesheet">
    <link href="{{ asset('plugins/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
	<link href="{{ asset('plugins/bower_components/bootstrap-daterangepicker/daterangepicker.css') }}" rel="stylesheet">
    <link href="{{ asset('plugins/bower_components/bootstrap-switch/bootstrap-switch.min.css') }}" rel="stylesheet">
	<link href="{{ asset('plugins/bower_components/bootstrap-daterangepicker/style.css') }}" rel="stylesheet">
@endsection
@section('main')
    @if (session('message'))
        <div>
            <input type="hidden" id="hidden" name="hidden" value="hidden">
            <input type="hidden" id="message" name="message" value="{{ session('message') }}">
            <input type="hidden" id="status" name="status" value="{{ session('status') }}">
        </div>
    @endif
    <div class="white-box">
        <form class="form-horizontal form-material" method="post" id='formid' enctype="multipart/form-data">
            <div class="row">	
                <div class="col-md-6 col-sm-4">
                    <div class="form-group">
                        <label class="col-md-12">名称</label>
                        <div class="col-md-12">
                            <input type="text" name="name" id="name"  value="{{$Cpeizhi->name}}"
                                   class="form-control form-control-line" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-sm-4">
                    <div class="form-group">
                        <label class="col-md-12">活动天数</label>
                        <div class="col-md-12">
                            <input type="text" name="day_num" id="day_num"  value="{{$Cpeizhi->day_num}}"
                                   class="form-control form-control-line" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-sm-4">
                    <div class="form-group">
                        <label class="col-md-12">金币数量</label>
                        <div class="col-md-12">
                            <input type="text" name="gold_num" id="gold_num"  value="{{$Cpeizhi->gold_num}}"
                                   class="form-control form-control-line" required>
                        </div>
                    </div>
                </div>
				<div class="col-md-6 col-sm-4">
                    <div class="form-group">
                        <label class="col-md-12">展示图</label>
                        <div class="col-md-12">
                            <div class="form-group ">
                                <input type="file" id="input-file-now-custom-3" class="dropify"
                                       name="pic_path"
                                       data-default-file="{{$Cpeizhi->pic_path}}"
                                       data-height="200px"/>
                            </div>
                        </div>
                    </div>
				</div>
			</div>	
			<div class="row">	
			
                <div class="col-md-2 col-sm-4">
                    <label class="control-label">是否删除</label>
                    <div class="example">
                        <select id="is_del" name="is_del">
                            @foreach(App\Cpeizhi::$DelDisplay as $key => $value)
                                <option value="{{ $key }}"  @if( $key==$Cpeizhi->is_del) selected  @endif>{{ $value }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
				
                <!--<div class="col-md-2 col-sm-4">
                    <label class="control-label">状态</label>
                    <div class="example">
                        <select id="status" name="status">
                            @foreach(App\Cpeizhi::$StatusDisplay as $key => $value)
                                <option value="{{ $key }}"  @if( $key==$Cpeizhi->status) selected  @endif>{{ $value }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>-->
				
			</div>	


        <div class="form-group" style="margin-top: 100px;">
            <button class="fcbtn btn btn-success btn-outline btn-1e waves-effect">修改
            </button>

            {!! csrf_field() !!}
            <a class="fcbtn btn btn-info btn-outline btn-1e waves-effect" href="{{ url('/punch/list') }}">返回
            </a>
        </div>
	</form>
    </div>

@endsection
@section('js')
    @parent
	 <script src="{{ asset('plugins/bower_components/moment/moment.js') }}"></script>
	<script src="{{ asset('plugins/bower_components/bootstrap-daterangepicker/daterangepicker.js') }}"></script>
	<script src="{{ asset('plugins/bower_components/bootstrap-daterangepicker/timePacker.js') }}"></script>
	

    <script>
        $(document).ready(function () {
            var hidden = $('#hidden').val();
            if (hidden === 'hidden') {
                if ($('#status').val() == 1) {
                    toastsuccess($('#message').val());
                } else {
                    toasterror($('#message').val());
                }
            }
        });
    </script>
@endsection